package com.wangxiang.shop.product.service.impl;

import com.wangxiang.common.utils.PageUtils;
import com.wangxiang.common.utils.Query;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import com.wangxiang.shop.product.dao.ClothingSkuDao;
import com.wangxiang.shop.product.entity.ClothingSkuEntity;
import com.wangxiang.shop.product.service.ClothingSkuService;


@Service("clothingSkuService")
public class ClothingSkuServiceImpl extends ServiceImpl<ClothingSkuDao, ClothingSkuEntity> implements ClothingSkuService {
    @Autowired
    private ClothingSkuDao clothingSkuDao;




    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ClothingSkuEntity> page = this.page(
                new Query<ClothingSkuEntity>().getPage(params),
                new QueryWrapper<ClothingSkuEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ClothingSkuEntity> getSkuBySpuId(ClothingSkuEntity clothingSkuEntity) {
        List<ClothingSkuEntity> skuBySpuId = clothingSkuDao.getSkuBySpuId(clothingSkuEntity.getSpuId());


        return skuBySpuId;
    }

}